import request from '@/utils/request'
// 封装登录接口函数
export const LoginFn = (data) => {
  return request.post('/user/login', data)
}
export const RegisterFn = (data) => {
  return request.post('/user/registered', data)
}
// 收藏列表获取接口函数
export const CollectFn = () => {
  return request.get('/user/favorites')
}
// 获取用户信息接口函数
export const GetuserFn = () => {
  return request.get('/user'

  )
}
// 获取登出接口函数
export const LogoutuserFn = () => {
  return request.post('/user/logout'

  )
}
// 获取房屋已发布列表
export const RentuserFn = (data) => {
  return request.get('/user/houses', {
    params: {
      ...data
    }
  }
  )
}
// 发布列表
export const GoRentFn = (data) => {
  return request.post('/user/houses', data

  )
}
// 查看收藏
export const getcollect = id => request.get(`/user/favorites/${id} `)
// 添加收藏
export const addlove = id => request.post(`/user/favorites/${id} `)
// 取消收藏
export const deletelove = id => request.delete(`/user/favorites/${id} `)
